package cn.e4j.modular.api.service;

import cn.e4j.core.dto.impl.Dto;
import cn.e4j.modular.api.mapper.Gwat151Mapper;
import cn.e4j.modular.crm.entity.GwbaT;
import cn.e4j.modular.crm.mapper.GwalTMapper;
import cn.e4j.modular.crm.mapper.GwbaTMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Created by wenchuan.li on 2018/6/14.
 */

@Service
public class Gwat151Service{

    @Autowired
    Gwat151Mapper gwat151Mapper;

    @Autowired
    GwbaTMapper gwbaTMapper;

    /**
     * 获取日历信息
     *
     * @param inDto
     * @return
     */
    public List<Dto> getGwba(Dto inDto) {

        return gwat151Mapper.getGwba(inDto);
    }

    /**
     * 获取所有事件
     *
     * @param inDto
     * @return
     */
    public List<Dto> getAllTask(Dto inDto) {
        return gwat151Mapper.getAllTask(inDto);
    }

    /**
     * 获取客户信息
     *
     * @param inDto
     * @return
     */
    public List<Dto> getGwakPage(Page<Object> page, Dto inDto) {
        return gwat151Mapper.getGwakPage(page,inDto);
    }

    /**
     * 保存
     * @param gwba_tPO
     */
    public void gwat151Save(GwbaT gwba_tPO) {
        gwba_tPO.insert();

//        gwbaTMapper.wx_insert((Dto) gwba_tPO.toDto());

    }

//    /**
//     * 修改
//     * @param gwba_tPO
//     */
//    public void gwat151Update(Dto gwba_tPO) {
//        gwbaTMapper.wx_updateByKey(gwba_tPO);
//    }

    /**
     * 删除
     * @param inDto
     */
    public void gwat151Delete(Dto inDto) {
        gwat151Mapper.deleteGwba(inDto);
    }

    /**
     * 获取该员工 日历中事件的最大项次
     * @param inDto
     * @return
     */
    public List<Dto> getTaskMax(Dto inDto) {
        return gwat151Mapper.getTaskMax(inDto);

    }
}
